package com.tbit.config.tg;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.tbit.business.auth.AuthConfig;
import org.tbit.business.tenant.service.TenantService;

/**
 * 自定义Bean构造器
 *
 * @author <a href="mailto:zhang.zhiliang@tbit.com.cn">Zhang ZhiLiang</a>
 * @version 1.0
 * @see <a href="http://adsl1.tbit.com.cn:21490/pages/viewpage.action?pageId=82182491">订单号规范</a>
 * @since 2025/2/7
 */
@Configuration
public class BeanConstructor {

    @Bean(name = "authConfig")
    public AuthConfig init(TbitAdminConfig config){
        return new AuthConfig(config.getUid(), config.getPrivateKey(), config.getUrl());
    }

    @Bean(name = "tenantService")
    public TenantService init(){
        return new TenantService();
    }

}
